﻿using Shinva.LADModel.Abstractions;
using Shinva.LADModel.Models;
using Shinva.Variables.Interface;
using Shinva.Variables.Type.bit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shinva.LADModel.Type.BitLogicOperations
{
    public class NOT : ElementNodeBase
    {
        public override PlcBool ENO {
            get
            {
                eno.Value = !en.Value;
                return eno;
            }
            set
            {
                eno = value;
            }
        }
        
        public override PlcBool EN {
            get
            {
                return en;
            }
            set
            {
                en = value;
            }
        
        }


        public override IPlcMember GetInterfaceVariableByName(string name)
        {
            if (name == "in") return EN;
            else if (name == "out") return ENO;
            else return variableTableInterface.GetVariableValue<IPlcMember>(name);
        }
    }
}
